import pyglet
from widget import BasicWrapper

class Sprite(BasicWrapper):
    
    def __init__(self, texture, *args, **kwargs):
        Widget.__init__(self, *args, **kwargs)

        spr = pyglet.sprite.Sprite(texture)
        self.add_child(spr, spr.width, spr.height)



class Label(BasicWrapper):

    def __init__(self, text, font='Times New Roman', size=20, 
                 color=(255, 255, 255, 255), *args, **kwargs):
        BasicWrapper.__init__(self, *args, **kwargs)

        label = pyglet.text.Label(text, font_name=font, font_size=size,
                                  color=color, anchor_y='bottom')
        self.add_child(label)


    def add_child(self, child):
        BasicWrapper.add_child(self, child, child.content_width,
                               child.content_height)
